package com.cx.service.impl;

import com.cx.mapper.GoodsMapper;
import com.cx.mapper.GroupGoodsMapper;
import com.cx.mapper.SeckillGoodsMapper;
import com.cx.pojo.Goods;
import com.cx.pojo.GroupGoods;
import com.cx.pojo.SeckillGoods;
import com.cx.service.IndexService;
import com.cx.vo.GroupGoodsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class IndexServiceImpl implements IndexService {
    @Autowired
    SeckillGoodsMapper seckillGoodsMapper;

    @Autowired
    GoodsMapper goodsMapper;

    @Autowired
    GroupGoodsMapper groupGoodsMapper;


    @Override
    public List<SeckillGoods> selectSeckillGoods() {
        return seckillGoodsMapper.selectSeckillGoods() ;
    }

    @Override
    public Goods findByGoodId(int goodId) {
        return goodsMapper.findByGoodId(goodId);
    }

    @Override
    public List<Goods> selectGoods() {
        return goodsMapper.selectAll();
    }

    @Override
    public List<GroupGoodsVO> selectGroupGoods() {
        return groupGoodsMapper.selectAll();
    }

    @Override
    public List<Goods> selectByGoodName(String goodName) {
        return goodsMapper.searchByGoodName(goodName);
    }
}
